﻿using System.Windows.Forms;
using MostRecentlyUsed.Interfaces;
using MostRecentlyUsed.Models.EventArguments;

namespace MostRecentlyUsed
{
    /// <summary>
    /// Individual menu item
    /// </summary>
    public partial class ConnectionStringMenuItem : ToolStripMenuItem, IConnectionStringMenuItem
    {
        /// <summary>
        /// Connection string details
        /// </summary>
        public SelectedConnectionString ConnectionString { get; internal set; }

        /// <summary>
        /// Initializes a new instance on the <see cref="ConnectionStringMenuItem"/> class
        /// </summary>
        public ConnectionStringMenuItem()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Initializes a new instance on the <see cref="ConnectionStringMenuItem"/> class
        /// </summary>
        /// <param name="connectionString">Connection string to wrap</param>
        public ConnectionStringMenuItem(SelectedConnectionString connectionString)
        {
            InitializeComponent();
            ConnectionString = connectionString;
            Text = connectionString.DisplayName;
        }
    }
}
